import request from '@/utils/request.js'
// import store from '@/store/index.js'

/* 登录请求接口
* 使用:调用该方法,即实现登录请求
* export 可多次暴露
* data 请求登录接口需要的参数
*/
// 登录接口
export const login = (data) => {
  return request({
    url: '/app/v1_0/authorizations',
    method: 'POST',
    data
  })
}
// 获取短信验证码
export const getCode = (mobile) => {
  return request({
    url: `/app/v1_0/sms/codes/${mobile}`,
    method: 'GET'
  })
}
// 获取用户自信息
export const getUserInfo = () => {
  return request({
    url: '/app/v1_0/user',
    method: 'GET'
    // headers: {
    //   Authorization: `Bearer ${store.state.user.token}`
    // }
  })
}
export const getUserChanel = () => {
  return request({
    url: '/app/v1_0/user/channels',
    method: 'GET'
  })
}
export const getChanelArticleList = (params) => {
  return request({
    url: '/app/v1_1/articles',
    method: 'GET',
    params
  })
}
